home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 43 / Amiga Format CD43 (1999)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1999-09].iso / -websites- / wirenet / files / wirenet151.lzx / Updates / SendEvents < prev    next >
Text File  |  1999-05-10  |  2KB  |  61 lines

  1. /* $VER: SendEvents 1.51 (30.10.96) (c) Neil Bothwick */
  2. /*                                                    */
  3. /* Check if there are any outstanding events and if   */
  4. /* so send them                                       */
  5.  
  6. /* Change these to suit your setup */
  7.  
  8. SystemName = 'Wirenet'                  /* The name of your Internet system in Thor */
  9. MaxTries   = 5                          /* Maximum number of retries */
  10. Logging    = 0                          /* Turn on logging, only use with Thor 2.3 and above */
  11. LogFile    = 'UUSpool:Connect.log'
  12.  
  13. /* Don't change anything below here */
  14.  
  15. EVE_DOWNLOAD     =  4
  16. EVE_UPLOAD       =  5
  17.  
  18. address command
  19.  
  20. if ~show('p', 'BBSREAD') then do
  21.     "run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
  22.     "WaitForPort BBSREAD"
  23.     end
  24.  
  25. if ~show('L','rexxdossupport.library') then
  26.     call addlib('rexxdossupport.library',0,-30)
  27.  
  28. CmdStr = GetVar('Thor/ThorPath')||'bin/SendTCP BBSNAME' SystemName 'MAILSERVER $SMTPSERVER NEWSSERVER $NEWSSERVER PUBSCREEN Workbench'
  29. if Logging = 1 then CmdStr = CmdStr 'LOGFILE' LogFile
  30.  
  31. do Try = 1 to MaxTries
  32.     if ActiveEvents() = 0 then leave
  33.     CmdStr
  34.     end
  35.  
  36. If ActiveEvents() > 0 then ExitMsg('SendTCP failed')
  37.  
  38. exit
  39.  
  40.  
  41. ActiveEvents:
  42.     address BBSREAD
  43.     ActiveCount = 0
  44.     GETBBSDATA SystemName SystemData
  45.     do EventNo=SystemData.FIRSTEVENT to SystemData.LASTEVENT
  46.         drop EventData.
  47.         drop EventTags.
  48.         READBREVENT '"'SystemName'"' eventnr EventNo datastem EventData tagsstem EventTags
  49.         EventFlags = c2x(EventData.FLAGS)
  50.         if EventFlags = 0 | EventFlags = 8 then return 1
  51.         end
  52.     address command
  53.     return 0
  54.  
  55. ExitMsg:
  56.     parse arg ErrMsg
  57.     say(ErrMsg)
  58.     exit
  59.     return
  60.  
  61.